package mse.tx.arch.pipe.systema;

import java.io.IOException;

import mse.tx.arch.pipe.filters.AltitudeConvertFilter;
import mse.tx.arch.pipe.filters.TempConvertFilter;

/******************************************************************************************************************
 * File:Plumber.java Course: 17655 Project: Assignment 1 Copyright: Copyright
 * (c) 2003 Carnegie Mellon University Versions: 1.0 November 2008 - Sample Pipe
 * and Filter code (ajl).
 * 
 * Description:
 * 
 * This class serves as an example to illstrate how to use the PlumberTemplate
 * to create a main thread that instantiates and connects a set of filters. This
 * example consists of three filters: a source, a middle filter that acts as a
 * pass-through filter (it does nothing to the data), and a sink filter which
 * illustrates all kinds of useful things that you can do with the input stream
 * of data.
 * 
 * Parameters: None
 * 
 * Internal Methods: None
 * 
 ******************************************************************************************************************/
public class Plumber {
	public static void main(String argv[]) throws IOException {
		/****************************************************************************
		 * Here we instantiate three filters.
		 ****************************************************************************/

		FileSrcFilter source1 = new FileSrcFilter("FlightData.dat");
		
		TempConvertFilter tempFilter = new TempConvertFilter();
		
		AltitudeConvertFilter altitudeFilter = new AltitudeConvertFilter();
		

		FileSinkFilter sink = new FileSinkFilter();
		
		tempFilter.connect(source1, "input", "output");
		altitudeFilter.connect(tempFilter, "input", "output");
		sink.connect(altitudeFilter, "input", "output"); 

		source1.start();
		
		tempFilter.start();
		
		altitudeFilter.start();

		sink.start();
	} // main

} // Plumber
